package com.study.model;

import javax.persistence.*;

import com.study.enums.StateEnum;
import com.study.typeHandlers.StateEnumHandler;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import tk.mybatis.mapper.annotation.ColumnType;

import java.util.Map;

@Data
@Table(name = "`country`")
public class Country {

    public Country() {
    }

    @Builder
    public Country(Integer id, String countryName, String countryCode, StateEnum state, Map<String, Object> extensions) {
        this.id = id;
        this.countryName = countryName;
        this.countryCode = countryCode;
        this.state = state;
        this.extensions = extensions;
    }

    /**
     * 主键
     */
    @Id
    @Column(name = "`id`")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;

    /**
     * 名称
     */
    @Column(name = "`country_name`")
    private String countryName;

    /**
     * 代码
     */
    @Column(name = "`country_code`")
    private String countryCode;

    @Column(name = "`state`")
    private StateEnum state;

    @Column(name = "`extensions`")
    private Map<String, Object> extensions;
}